home *** CD-ROM | disk | FTP | other *** search
- { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
- Memory allocation demonstration
-
- EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
- MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
- ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
-
-
- uses EFLIBMEM;
-
- var Allocation1, Allocation2 : AllocationObjectType;
- Data : string;
-
-
- begin
- Data := 'Some temporary data to test';
-
- Allocation1.InitializeEmpty;
- Allocation1.MoveIn (@Data, SizeOf(Data), 0);
- Allocation2.InitializeEmpty;
- Allocation2.MoveIn (Allocation1.DataPointer(0), Allocation1.DataSize, 0);
-
- Write (String(Allocation2.DataPointer(0)^), ' = ');
- WriteLn (String(Allocation1.DataPointer(0)^));
- end.